#!/bin/bash
source experiment.cfg
controller_dns=$(cat $controller_dns_file)
ssh -i $key_file -o StrictHostKeyChecking=no ec2-user@$controller_dns "killall java" &
echo "Killed controller on $controller_dns"
cat $node_dns_file | while read line; 
do
    ssh -i $key_file -o StrictHostKeyChecking=no ec2-user@${line} "ps -ef | grep java | grep Main | awk {'print \$2'} | xargs kill" &
    echo "Killed node on ${line}";
done
